<template>
  <div class="seek-help">
    <app-header :back="true" titleContent="邻里求助" helpTitle="发布求助"></app-header>
    <div v-for="(item,index) in lists" :key="index" class="list">
      <panel :list="[
          {
            src: item.img[0],
            title: item.title,
            desc: item.content,
            url: '/seekHelpDetail/'+ item.id,
            meta: {
              source: item.areas_name,
            }
          }
        ]" type="5">
        </panel>
       <span class="time">{{item.create_time*1000 | datego(item.create_time*1000)}}</span>
    </div>
  </div>
</template>

<script>
import AppHeader from '../header/header'
import {Panel} from 'vux'
import {getHelpList} from '../../api/seekHelp.js'
export default {
  name: 'seekHelp',
  data () {
    return {
      list: []
    }
  },
  components: {
    AppHeader,
    Panel
  },
  created () {
    this._getHelpList()
  },
  methods: {
    _getHelpList () {
      getHelpList().then(res => {
        this.list = res.data
      })
    }
  },
  computed: {
    lists () {
      return this.list.reverse()
    }
  }
}
</script>

<style lang="less">
  .seek-help{
    .list {
      position: relative;
      .time{
        position: absolute;
        bottom: 14px;
        right: 10px;
        color: #CECECE;
        font-size: 13px;
      }
    }
    .weui-media-box{
      padding: 10px;
    }
    .weui-media-box_appmsg .weui-media-box__hd{
      width: 80px;
    }
    .weui-media-box_appmsg .weui-media-box__thumb{
      vertical-align: middle;
    }
    .weui-panel{
      margin-top: 0;
    }
    .weui-panel:before{
      border-top: 1px solid transparent;
    }
    .weui-media-box__info__meta_extra {
      border-left: 1px solid transparent;
      color: red;
    }
  }
</style>
